package main

type Lib struct {
	option1 string
	option2 string
}

type libFunc func(*Lib)

func WithOption1(option string) libFunc {
	return func(l *Lib) {
		l.option1 = option
	}
}

func WithOption2(option string) libFunc {
	return func(l *Lib) {
		l.option2 = option
	}
}

func NewLib(options ...libFunc) *Lib {
	lib := Lib{}
	for _, option := range options {
		option(&lib)
	}

	return &lib
}
